<template>
  <el-dialog
    :visible.sync="dialogVisible"
    :before-close="handleClose"
    :close-on-click-modal="false"
    :title="$t('details')"
    width="60%">
    <dynTable
      ref="dynTable"
      :loading="fasle"
      :table-data="tableData"
      :table-columns="tableColumns"
    />
  </el-dialog>
</template>

<script>
import mySetting from '@/mixins/mySetting'
import actionHistoryApi from '@/api/alarm/actionHistory'
export default {
  name: 'ActionHistoryForm',
  components: {},
  mixins: [mySetting],
  props: {},
  data() {
    return {
      dialogVisible: false,
      tableColumns: [
        { prop: '', label: this.$t('index'), type: 'index', width: '50px', templete: (_scope) => {
          return (
            <span>{ (this.listQuery.page - 1) * this.listQuery.size + _scope.$index + 1 }</span>
          )
        } },
        { prop: 'alarmAction', label: '执行动作' },
        { prop: 'systemTime', label: '执行时间' },
        { prop: 'result', label: '执行结果' },
        { prop: 'eqpID', label: '责任人' },
        { prop: 'eqpID', label: '解锁人' },
        { prop: 'eqpID', label: '解锁时间' },
        { prop: 'remark', label: '备注' }
      ]
    }
  },
  methods: {
    async handleOpen(id) {
      const res = await actionHistoryApi.getInfo({ id })
      this.tableData = res.data
      this.dialogVisible = true
      this.options.loading = false
    },
    handleClose() {
      Object.assign(this.$data, this.$options.data.call(this))
    }
  }
}
</script>

<style scoped lang="scss"></style>
